<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<div id="app">
			<!-- HTML属性不支持驼峰属性 -->
			<cpn :c-info="info" :in-my-message="message"></cpn>
		</div>
		<template id="cpn">
			<div>
				<h2>{{cInfo}}</h2>
				<p>{{inMyMessage}}</p>
			</div>
		</template>

		<script src="../lib/vue.js"></script>
		<script>
			let cpn = {
				template: "#cpn",
				props: {
					cInfo: {
						type: Object,
						default() {
							return {};
						}
					},
					inMyMessage: String
				}
			};
			let vm = new Vue({
				el: "#app",
				data: {
					message: "hello",
					info: {
						name: "why",
						age: 18,
						height: 1.88
					}
				},
				methods: {},
				components: {
					cpn
				}
			});
		</script>
	</body>
</html>
